<template>
  <header class="header">
      <h1>任务列表</h1>
      <input @keyup.enter="add" v-model.trim="todoname" class="new-todo" placeholder="请输入要做的事情" autofocus />
    </header>
</template>

<script>
export default {
    data() {
      return {
        todoname:''
      }
    },
    methods:{
      add () {
        this.$emit('add',this.todoname)
        this.todoname = ''
      }
    }
}
</script>

<style>

</style>